<div class="users index">
	<h2><?php echo __('Usuários'); ?></h2>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo $this->Paginator->sort('username'); ?></th>
			<th><?php echo $this->Paginator->sort('nome'); ?></th>
			<th><?php echo $this->Paginator->sort('socio', 'Sócio'); ?></th>
			<th><?php echo $this->Paginator->sort('estudante'); ?></th>
			<th><?php echo $this->Paginator->sort('valor_total'); ?></th>
			<th><?php echo $this->Paginator->sort('comprovante'); ?></th>
			<th></th>
			
	</tr>
	<?php
	foreach ($users as $user): ?>
	<tr>
		<!--<td><?php echo h($user['User']['id']); ?>&nbsp;</td> -->
		<td><?php echo h($user['User']['username']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['nome']); ?>&nbsp;</td>
		<?php if($user['User']['socio']){?>
		<td>Sim</td>
		<?php }else{?>
		<td>Não</td>
		<?php }?>
		<?php if($user['User']['estudante']){?>
		<td>Sim</td>
		<?php }else{?>
		<td>Não</td>
		<?php }?>
		<td>R$ <?php echo $user['User']['valor_total'];?>,00 </td>
		<?php if($user['User']['comprovante'] === NULL) { ?>
		<td>Comprovante não enviado</td>
		<?php } else { ?>
		<td><?php echo $this->Html->link('Baixar comprovante', '/'.$user['User']['comprovante']); ?>&nbsp;</td>
		<?php } ?>
		<td class="actions">
			<?php echo $this->Html->link(__('Marcar como pago'), array('action' => 'pagar', $user['User']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
<?php
	echo $this->Paginator->counter(array(
	'format' => __('Página {:page} de {:pages}, mostrando {:current} usuários de {:count}')
	));
	?>	</p>

	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('Anterior'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('Próximo') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>